<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="jquery-1.9.1.js"></script>
<script type="text/javascript">
	$(document).ready(function(){
		$("#writeBtn").click(function(){
			if ($("input[name=hopeday]").val() == "") {
				alert("원하는 날짜를 입력하세요");
				return false;
			}
			if ($("input[name=hopetime]").val() == "") {
				alert("원하는 시간을 입력하세요");
				return false;
			}
			$("#writeLessonForm").submit();
		});
		$("#update").click(function(){
			location.href="main.do";/*수정버튼을 눌렀을 때 수정페이지로 간다.  */
		});
		
	});
</script>
</head>
<body>

<h1><font style="font-style: normal;"></font></h1>
<center>
${sessionScope.mvo }
<form action="writeLessonBoard.do" method="post" id="writeLessonForm" enctype="multipart/form-data">

<table>
<tr>
	<td bgcolor="#E6E6E6" width="100" align="center"><font size="2">이름 </font></td>
	<td ><input type="text" value="${sessionScope.mvo.name }" id="name"  name="name" readonly="readonly"> </td>
	<td bgcolor="#E6E6E6" width="100" align="center"><font size="2">학년</font> </td>
	<td><input type="text" value="${sessionScope.mvo.grade }" id="grade"  name="grade" readonly="readonly"> </td>
</tr>
<tr>
	<td bgcolor="#E6E6E6" width="100" align="center"><font size="2">성별</font></td>
	<td><input type="text" value="${sessionScope.mvo.gender }" id="gender"  name="gender" readonly="readonly"></td>
	<td bgcolor="#E6E6E6" width="100" align="center"><font size="2">전화번호</font></td>
	<td><input type="text" value="${sessionScope.mvo.tel }" id="tel"  name="tel" readonly="readonly"></td>
</tr>
<tr>
	<td bgcolor="#E6E6E6" width="100" align="center"><font size="2">원하는 수업</font></td>
	<td><input type="text" value="${sessionScope.mvo.hopesubject }" id="hopesubject"  name="hopesubject" readonly="readonly"></td>
	<td bgcolor="#E6E6E6" width="100" align="center"><font size="2">연결여부</font></td>
	<td><input type="text" value="연결가능" readonly="readonly"></td>
</tr>
<tr>
	<td bgcolor="#E6E6E6" width="100" align="center"><font size="2">원하는 요일</font></td>
	<td><input type="text"  id="hopeday" name="hopeday" ></td>
	<td bgcolor="#E6E6E6" width="100" align="center"><font size="2">원하는 시간</font></td>
	<td><input type="text" id="hopetime" name="hopetime" ></td>
</tr>
</table>
<hr>
<table>
<tr>
	<td><font size="2">제목:</font></td>
	<td><font size="2"><input type="text" name="title" id="title"></font></td>
</tr>
<tr>
	<td><font size="2">작성자:</font></td>
	<td><font size="2"><input type="text" name="studentid" id="studentid" value="${sessionScope.mvo.id}" readonly="readonly"></font></td>
</tr>
<tr>
	<td colspan="2"><font size="2"><textarea rows="20" cols="50"  id="content" name="content"></textarea></font></td>
</tr>
<tr>
	<td colspan="2" align="center"><br><input type="button" id="writeBtn" value="글쓰기"></td>
</tr>
</table>
</form>
</center>
</body>
</html>